package com.ruiyi.adrobot.mongo.robot;

import com.mongodb.DBObject;
import com.ruiyi.adrobot.beans.Group;
import com.ruiyi.adrobot.beans.Robot;
import com.ruiyi.adrobot.beans.common.MongoPageRequest;
import com.ruiyi.adrobot.beans.socket.Heart;
import org.springframework.data.domain.Page;
import org.springframework.data.mongodb.core.query.Update;

import java.util.List;

public interface RobotOperations {
    void updateOnlineAndBusyFalse();

    Long countByGroupNameAndNickName(String groupName, String nickName);

    void updateBySimCode(String excuteSimCode, Update updateRobot);

    Page<Robot> getListByPage(MongoPageRequest<Robot> mongoPageRequest);

    List<Robot> getCanExcuteRobotsByOnlineAndBusyAndGroupNameAndLockTimeLessThan(List<String> groupNames);

    List<Group> findGroups(Boolean online);

    void updateRobotStatus(Heart heart);

    DBObject getTaskByTaskDetailIdAndTaskNum(String id, Integer num);
}
